﻿
         $(function () {
             
             //点击数据统计激发事件显示城市列表
             $("#list").click(function () {
                 $("#cityList").css("top", "34px").css("left", "2px").show();

             });
             //点击列表右边的叉关闭城市列表
             $("#closeCityList").click(function () {
                 $("#cityList").hide();
             });
             //获取城市列表
             $.post("../BLL/City.ashx", { "action": "GetCityLists" }, function (data, status) {
                 if (status == "success") {
                     var city = $.parseJSON(data);
                     $("#citiesLists").empty();

                     for (var i = 0; i < city.length; i++) {
                         var name = city[i].Name;
                         var cityCode = city[i].SelfCode;
                         var a = '<a href="#" name=' + name + ' code=' + cityCode + ' >' + name + '</a>' + '     ';
                         $("#citiesLists").append(a);
                     }
                 }
                 $("a[name]").each(function () {
                     $(this).click(function () {
                         var name = $(this).attr("name");
                         var cityCode = $(this).attr("code");

                         var chkdlb = $("#DLB").attr("checked");
                         if (chkdlb == true) {
                             $("#dataStatistic").attr("src", "P_CStatistics.aspx?name="+name+"&cityCode="+cityCode);
                         }
                         else {
                             $("#dataStatistic").attr("src", "P_CLEDSatistics.aspx?name=" + name + "&cityCode=" + cityCode);
                         }
                        // return false;
                     });
                 });

             });

             $("#henan").click(function () {
                 var chkdlb = $("#DLB").attr("checked");
                 // var chkled = $("#LED").attr("checked");
                 if (chkdlb == true) {
                     $("#dataStatistic").attr("src", "ProvinceStatistics.aspx");
                 }
                 else {
                     $("#dataStatistic").attr("src", "ProvinceLEDStatistics.aspx");
                 }

             });

         });
     
